<template>
  <div>
  <span id="PrintRow" >

      <div id='printMe'>
  <el-row>
    <el-col :span="2.5" >
      <h3> <b>|基本资料</b></h3>
    </el-col>
    <el-col align="right" :span="17">
      <el-button v-print="'printMe'">打印基本资料</el-button>
      <el-button      v-print="printObj">打印全部</el-button>
    </el-col>
  </el-row>
  <br>
  <table  border="1"  cellspacing="0" cellpadding="0"  style="width: 80%">
    <tr>
      <td>案号:<br><b>{{tabledata.caseNo}}</b></td>
      <td>提交时间:<br><b>{{tabledata.caseSubtime}}</b></td>
    </tr>

    <tr>
      <td>案件类型:<br><b>{{tabledata.caseCaseTypeName}}</b></td>
      <td>收案时间:<br><b>{{tabledata.collectionTime}}</b></td>
    </tr>

    <tr>
      <td>委托人:<br><b>{{tabledata.caseWtr}}</b></td>
      <td>对方当事人:<br><b>{{tabledata.caseOppositeParties}}</b></td>
    </tr>

    <tr>
      <td>第三方:<br><b>{{tabledata.caseThirdParty}}</b></td>
      <td>承办律师:<br><b>{{tabledata.caseAttorney}}</b></td>
    </tr>

    <tr>
      <td>诉讼地位:<br><b>{{tabledata.caseLawsuitStatus}}</b></td>
      <td>诉讼阶段:<br><b>{{tabledata.caseStatus}}</b></td>
    </tr>

    <tr>
      <td>诉讼标的:<br><b>{{tabledata.caseLawsuitobj}}</b></td>
      <td>代理费:<br><b>{{tabledata.caseAgencyfee}}</b></td>
    </tr>
 <tr>
    <td>收费方式:<br><b>{{tabledata.caseChargeWay}}</b></td>
    <td>是否享受政府补助:<br><b>{{ (tabledata.caseSubsidy=='Y'?'是':'否')}}</b></td>
  </tr>
  <tr>
    <td>补助金额:<br><b>{{tabledata.caseSubsidysal}}元</b></td>
    <td>收案申请状态:<br><b>{{(tabledata.caseApproveStatus=='1'?'审批中':(tabledata.caseApproveStatus=='2'?'审批通过':(tabledata.caseApproveStatus=='3'?'审批不通过':"null")))}}</b></td>
  </tr>
  <tr>
    <td colspan="2">案由:<br>
      <b>{{tabledata.caseCause}}</b>
    </td>

  </tr>
  <tr>
    <td colspan="2">备注:<br>
      <b>{{tabledata.caseRemarks}}</b>
    </td>
  </tr>
</table>
</div>

  <br><br><br>
<!--  第二个表-->
  <el-row>
    <el-col :span="2.5">
      <h3> <b>|承办律师</b></h3>
    </el-col>
  </el-row>
  <el-table
      :data="datas"
      border
      style="width: 80%">
    <el-table-column
        prop="caseAttorney"
        label="类型"
        width="180%">
    </el-table-column>
    <el-table-column
        prop="empName"
        width="200%"
        label="姓名"
       >
    </el-table-column>
    <el-table-column

        prop="cwPerformancesplit"
        label="业绩分成">
    </el-table-column>
    <el-table-column
        prop="cwSplitType"

        label="分成方式">
    </el-table-column>

  </el-table>

  <br><br><br>
  <!--  第三个表-->
  <el-row>
    <el-col :span="2.5">
      <h3> <b>|公函记录</b></h3>
    </el-col>
  </el-row>
  <el-table
      :data="routs"
      border
      style="width: 80%">
    <el-table-column
        prop="caseNo"
        label="案号"
        width="180">
    </el-table-column>
    <el-table-column
        prop="applyforRecipient"
        label="领用人"
        width="180">
    </el-table-column>
    <el-table-column
        prop="sendPerson"
        label="收函方">
    </el-table-column>
    <el-table-column
        prop="itemName"
        label="用印事项">
    </el-table-column>
    <el-table-column
        prop="applyforReceive"
        label="领用日期">
    </el-table-column>

    <el-table-column
        prop=""
        label="审批状态">
      <template  slot-scope="scope">
        {{(scope.row.applyforApprovalStatus=='1'?'审批中':(scope.row.applyforApprovalStatus=='2'?'审批通过':
          (scope.row.applyforApprovalStatus=='3'?'审批不通过':"")))}}
      </template>
    </el-table-column>

  </el-table>
  </span>
</div>

</template>

<script>

export default {
  name: "CwInoutLURUtianjiaHOU.vue"
 , data(){
    return{
     "caseLawId": this.$route.query.caseLawId , //案件id
      tabledata:{},  //存储基本资料信息
      datas:[],//存储 承办律师的信息
      routs:[],//存储 公函记录
      printObj: {
        id: "PrintRow",//打印区域 Dom ID
        popTitle: '',  // 打印的标题
        extraCss: '',  // 打印可引入外部的一个 css 文件
        extraHead: ''  // 打印头部文字
         }


    }
  },methods:{
    // 拿案件id去找这条数据 打印基本信息
    getli() {
    this.$http.get("/caseLaw", {params:{"id":this.caseLawId}}).then(res=>{
  // console.log("基本信息"+res.data.data.list[0])
      this.tabledata=res.data.data.list[0];
    })

    },
    //拿案件id去找cw_performancesplit 和hr_emp的链表
    getlier(){
      this.$http.get("/cwPerformancesplit/id/cwPerformancesplit", {params:{"caseLawId":this.caseLawId}}).then(res=>{
       this.datas=res.data.data;
        //console.log(this.datas)
      })
    },
    //拿案件id去找公函记录case_seal_applyfor
    getlisan(){
      this.$http.get("/caseSealApplyfor", {params:{"id":this.caseLawId}}).then(res=>{
        this.routs=res.data.data;
        console.log("公函记录\n"+this.routs)
      })
    }
  },created() {
    this.getli();//渲染基本信息
    this.getlier();//拿案件id去找cw_performancesplit 和hr_emp的链表
    this.getlisan();//拿案件id去找公函记录case_seal_applyfor
  }
}
</script>

<style scoped>





table {
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #f0f2f5;
  border-collapse: collapse;
  color: #454545;
  table-layout: auto;
  width: 100%;
  text-align: center;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: #dadcde;
}
thead {
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: #dadcde;
  line-height: 40px;
  font-weight: bold;
  color: #454c70;
}

tr {
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: #dadcde;
  line-height: 23px;
}

td {
  padding: 5px 10px;
  font-size: 14px;
  font-family: Verdana;
  width: 100px;
  word-break: break-all;
}

tr:nth-child(even) {
  background: #F5F7F9;
}

tr:nth-child(odd) {
  background: #FFF;
}


/*去除页眉页脚*/
@page{
  size:  auto;   /* auto is the initial value */
  margin: 3mm;  /* this affects the margin in the printer settings */
}

html{
  background-color: #FFFFFF;
  margin: 0;  /* this affects the margin on the html before sending to printer */
}

body{
  border: solid 1px blue ;
  margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
}
/*去除页眉页脚*/

</style>